﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using QuanLyHocPhi.Model;
using QuanLyHocPhi.BLL;

namespace QuanLyHocPhi.GUI
{
    static class Program
    {
        #region Thuộc tính
        private static FormMain m_FormMain = null;
        public static FormMain FormMain
        {
            get
            {
                if (m_FormMain == null)
                    m_FormMain = new FormMain();
                return m_FormMain;
            }
        }
        #endregion

        #region Thuộc tính ứng dụng
        private static NguoiSuDung m_NguoiSuDung;
        public static NguoiSuDung NguoiSuDung
        {
            get { return m_NguoiSuDung; }
            set
            {
                m_NguoiSuDung = value;
                Program.FormMain.UpdateNguoiSuDung();
            }
        }

        //private static HocKy m_HocKy = null;
        //public static HocKy HocKy
        //{
        //    get { return m_HocKy; }
        //    set
        //    {
        //        m_HocKy = value;
        //        Program.FormMain.UpdateHocKy();
        //    }
        //}
        #endregion

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
            Application.Run(Program.FormMain);
            //Application.Run(new GUI.TacNghiep.FormThongKeTheoNgay());
        }

        static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
        {
            DialogUtils.ShowError("Xuất hiện lỗi " + e.Exception.Message);
        }
    }
}
